from django import forms
from .models import Pet, HealthRecord
from bootstrap_datepicker_plus import DatePickerInput

class PetForm(forms.ModelForm):
    class Meta:
        model = Pet
        fields = ['name', 'pet_type', 'birth_date', 'gender', 'breed', 'photo', 'special_needs']
        widgets = {
            'birth_date': DatePickerInput(),
            'special_needs': forms.Textarea(attrs={'rows': 3}),
        }
        help_texts = {
            'birth_date': 'Approximate date if unknown'
        }

class HealthRecordForm(forms.ModelForm):
    class Meta:
        model = HealthRecord
        fields = ['date', 'weight', 'height', 'temperature', 'notes']
        widgets = {
            'date': DatePickerInput(),
            'notes': forms.Textarea(attrs={'rows': 3}),
        }
